﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using EventPlanner.Models;


namespace EventPlanner.DAL
{
    public class EventPlannerContext : DbContext, IEventPlannerContext
    {
        public IDbSet<Evento> Eventos { get; set; }
        public IDbSet<Cuenta> Cuentas { get; set; }
        public IDbSet<Participante> Participantes { get; set; }
        public IDbSet<Organizador> Organizadores { get; set; }
        public IDbSet<Contacto> Contactos { get; set; }

        public static String UsuarioActual { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }

        public void SetUsuarioActual(String u)
        {
            UsuarioActual = u;
        }

        public String GetUsuarioActual()
        {
            return (UsuarioActual);
        }
    }
}